﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WapCrawler.Classes
{

    public class ConvertTCVNToUTF8
    {
        const int DEFAULT_CODE = 0;
        const int TCVN_LOWER_CODE = 1;
        const int TCVN_UPER_CODE = 2;
        const int VNI_CODE = 3;
        const int VIETWARE_CODE = 4;
        const int UNICODE = 5;
        const int NON_MASK = 6;

        private string[] LOWER_TCVN_TO_HTML_UNICODE =
        new string[]{
"\x00","\x01","\x02","\x03","\x04","\x05","\x06","\x07",
"\x08","\x09","\x0A","\x0B","\x0C","\x0D","\x0E","\x0F",
"\x10","\x11","\x12","\x13","\x14","\x15","\x16","\x17",
"\x18","\x19","\x1A","\x1B","\x1C","\x1D","\x1E","\x1F",
"\x20","\x21","\x22","\x23","\x24","\x25","\x26","\x27",
"\x28","\x29","\x2A","\x2B","\x2C","\x2D","\x2E","\x2F",
"\x30","\x31","\x32","\x33","\x34","\x35","\x36","\x37",
"\x38","\x39","\x3A","\x3B","\x3C","\x3D","\x3E","\x3F",
"\x40","\x41","\x42","\x43","\x44","\x45","\x46","\x47",
"\x48","\x49","\x4A","\x4B","\x4C","\x4D","\x4E","\x4F",
"\x50","\x51","\x52","\x53","\x54","\x55","\x56","\x57",
"\x58","\x59","\x5A","\x5B","\x5C","\x5D","\x5E","\x5F",
"\x60","a","\x62","\x63","\x64","e","\x66","\x67",
"\x68","i","\x6A","\x6B","\x6C","\x6D","\x6E","o",
"\x70","\x71","\x72","\x73","\x74","u","\x76","\x77",
"\x78","y","\x7A","\x7B","\x7C","\x7D","\x7E","\x7F",
"\x80","\x81","\x82","\x83","\x84","\x85","\x86","\x87",
"\x88","\x89","\x8A","\x8B","\x8C","\x8D","\x8E","\x8F",
"\x90","\x91","\x92","\x93","\x94","\x95","\x96","\x97",
"\x98","\x99","\x9A","\x9B","\x9C","\x9D","\x9E","\x9F",
"\xA0","&#258;","&#194;","&#202;","&#212;","&#416;","&#431;","&#272;",
"&#259;","&#226;","&#234;","&#244;","&#417;","&#432;","&#273;","\xAF",
"\xB0","\xB1","\xB2","\xB3","\xB4","&#224;","&#7843;","&#227;",
"&#225;","&#7841;","\xBA","&#7857;","&#7859;","&#7861;","&#7855;","\xBF",
"\xC0","\xC1","\xC2","\xC3","\xC4","\xC5","&#7863;","&#7847;",
"&#7849;","&#7851;","&#7845;","&#7853;","&#232;","\xCD","&#7867;","&#7869;",
"&#233;","&#7865;","&#7873;","&#7875;","&#7877;","&#7871;","&#7879;","&#236;",
"&#7881;","\xD9","\xDA","\xDB","&#297;","&#237;","&#7883;","&#242;",
"\xE0","&#7887;","&#245;","&#243;","&#7885;","&#7891;","&#7893;","&#7895;",
"&#7889;","&#7897;","&#7901;","&#7903;","&#7905;","&#7899;","&#7907;","&#249;",
"\xF0","&#7911;","&#361;","&#250;","&#7909;","&#7915;","&#7917;","&#7919;",
"&#7913;","&#7921;","&#7923;","&#7927;","&#7929;","&#253;","&#7925;","\xFF"
};
    }
}